<?php
/**
 * @version		2.0.1 | $Id: tableplayer.php 114 2009-09-02 12:43:54Z mwi.nor $
 */

// no direct access
defined( '_JEXEC' ) or die();
	$cparams =& JComponentHelper::getParams('com_matchdart');
?>
<div class="contentdescription<?php echo $this->escape($cparams->get('pageclass_sfx')); ?>" align="center">
<p>&nbsp;</p>
<?php echo JText::_( 'MD_TABLE_EVENT_PLAYOFFS' ); ?>
</div>

<table class="contentpane<?php echo $cparams->get('pageclass_sfx'); ?>">
	<tr class="sectiontableheader<?php echo $this->escape($cparams->get('pageclass_sfx')); ?>">
    	<td align="center" colspan="0"><?php echo JText::_( 'MD_PLAYER_PLAYOFF_MATCHTYPE' ); ?></td>
    	<td align="center" colspan="0"><?php echo JText::_( 'MD_PLAYER_PLAYOFF_MATCH' ); ?></td>
    	<td align="center" colspan="0"><?php echo JText::_( 'MD_PLAYER_PLAYOFF_MATCHRESULT' ); ?></td>
    	<td align="center" colspan="0"><?php echo JText::_( 'MD_PLAYER_PLAYOFF_MATCHLWAT' ); ?></td>
    	<td align="center" colspan="0"><?php echo JText::_( 'MD_PLAYER_PLAYOFF_MATCH100' ); ?></td>
    	<td align="center" colspan="0"><?php echo JText::_( 'MD_PLAYER_PLAYOFF_MATCH140' ); ?></td>
    	<td align="center" colspan="0"><?php echo JText::_( 'MD_PLAYER_PLAYOFF_MATCH180' ); ?></td>
    	<td align="center" colspan="0"><?php echo JText::_( 'MD_PLAYER_PLAYOFF_MATCHHC' ); ?></td>
	</tr>
<?php
    $pm_items =& $this->pm_items;
    $pos = 1; 
    $temptype = '';
    $playoffline = Array(1,3,7,15,31);

    foreach($pm_items as $pm_item) : ?>
		<tr class="sectiontableentry<?php echo $this->escape($cparams->get('pageclass_sfx')); ?>">
	    	<td align="right">
	    		<?php
	    			if ($pm_item->MatchType != $temptype){
	    			switch ( $pm_item->MatchType )
	    			{
	    				case '1'  :
	    				echo JText::_( 'MD_MATCH_TYPE_BEST_2');
	    				break;
	    				
	    				case '2'  :
	    				echo JText::_( 'MD_MATCH_TYPE_BEST_4');
	    				break;
	    				
	    				case '4'  :
	    				echo JText::_( 'MD_MATCH_TYPE_BEST_8');
	    				break;
	    				
	    				case '8'  :
	    				echo JText::_( 'MD_MATCH_TYPE_BEST_16');
	    				break;
	    				
	    				case '16'  :
	    				echo JText::_( 'MD_MATCH_TYPE_BEST_32');
	    				break;
	    			}
	    			} else {
	    				echo '&nbsp';
	    			}
	    		?>
	    	</td>
	    	<td align="center"><?php echo ($pm_item->MatchResult == 1) ? '<strong>'.$pm_item->HomePlayerName.'</strong>'.' - '.$pm_item->AwayPlayerName :  $pm_item->HomePlayerName.' - '.'<strong>'.$pm_item->AwayPlayerName.'</strong>'; ?></td>
	    	<td align="center"><?php echo $pm_item->MatchHomeLegs.' - '.$pm_item->MatchAwayLegs; ?></td>
	    	<td align="center"><?php echo $pm_item->MatchHomeLWAT.' - '.$pm_item->MatchAwayLWAT; ?></td>
	    	<td align="center"><?php echo $pm_item->MatchHome100.' - '.$pm_item->MatchAway100; ?></td>
	    	<td align="center"><?php echo $pm_item->MatchHome140.' - '.$pm_item->MatchAway140; ?></td>
	    	<td align="center"><?php echo $pm_item->MatchHome180.' - '.$pm_item->MatchAway180; ?></td>
	    	<td align="center"><?php echo $pm_item->MatchHomeHC.' - '.$pm_item->MatchAwayHC; ?></td>
    	</tr>
		<?php if (in_array($pos, $playoffline)) : ?>
			<tr class="sectiontableentry<?php echo $this->escape($cparams->get('pageclass_sfx')); ?>">
				<td height="5" colspan="8" align="center" valign="middle">
					<img src="components/com_matchdart/images/line.gif" width="98%" height="5" alt="MD_LINE">
				</td>
			</tr>
		<?php endif; ?>
    	
	<?php 
	$pos++;
	$temptype = $pm_item->MatchType;
	endforeach; ?>
</table>
